home *** CD-ROM | disk | FTP | other *** search
/ Champak 138 / Volume 138 Aug 19 2011 - Damaged.iso / Games / shadez.swf / scripts / Local / CGlobal.as next >
Text File  |  2011-08-19  |  12KB  |  384 lines

  1. package Local
  2. {
  3.    import Local.External.CKongregate;
  4.    import Local.External.CMochiBot;
  5.    import flash.events.EventDispatcher;
  6.    import flash.net.SharedObject;
  7.    
  8.    public class CGlobal extends EventDispatcher
  9.    {
  10.       
  11.       private static var _ShowMessages:Boolean = true;
  12.       
  13.       public static var mLocalStats:Object;
  14.       
  15.       private static var mFields:Object;
  16.       
  17.       private static var _FastRender:Boolean = false;
  18.       
  19.       private static var _SoundActive:Boolean = true;
  20.       
  21.       public static var mLoadCPMStar:Boolean = ┬º┬ºpop();
  22.       
  23.       public static const mDebug:Boolean = false;
  24.       
  25.       public static var mShowIntro:Boolean = !mDebug;
  26.       
  27.       public static var mStatsEnabled:Boolean = true;
  28.       
  29.       public static var mStats:Object;
  30.       
  31.       public static var mShowVideoTimer:Boolean = false;
  32.       
  33.       public static var mProfiler:Boolean = false;
  34.       
  35.       private static var mUnitNames:Object;
  36.       
  37.       private static var mShared:SharedObject;
  38.       
  39.       public static var mLoadingTime:int;
  40.       
  41.       {
  42.          ┬º┬ºpush(┬º┬ºfindproperty(mLoadCPMStar));
  43.          ┬º┬ºpush(mDebug);
  44.          if(true)
  45.          {
  46.             ┬º┬ºpush(!!┬º┬ºpop() ? false : true);
  47.          }
  48.          ┬º┬ºpush(┬º┬ºfindproperty(mLoadingTime));
  49.          if(true)
  50.          {
  51.             if(mDebug)
  52.             {
  53.                (1 * 1000).mLoadingTime = true ? int(┬º┬ºpop()) : int(┬º┬ºpop());
  54.                mShowVideoTimer = false;
  55.                _FastRender = false;
  56.                _SoundActive = true;
  57.                _ShowMessages = true;
  58.                return;
  59.                addr43:
  60.             }
  61.             else
  62.             {
  63.                ┬º┬ºpush(7 * 1000);
  64.             }
  65.             ┬º┬ºgoto(addr53);
  66.          }
  67.          ┬º┬ºgoto(addr43);
  68.       }
  69.       
  70.       public function CGlobal()
  71.       {
  72.          if(true)
  73.          {
  74.             super();
  75.          }
  76.       }
  77.       
  78.       public static function ResetLocalStats() : void
  79.       {
  80.          mLocalStats = new Object();
  81.       }
  82.       
  83.       public static function set mFastRender(param1:Boolean) : void
  84.       {
  85.          SetField("fastrender",_FastRender = param1);
  86.       }
  87.       
  88.       public static function get mSoundActive() : Boolean
  89.       {
  90.          return _SoundActive;
  91.       }
  92.       
  93.       public static function IncrementStat(param1:String) : uint
  94.       {
  95.          if(!mStatsEnabled)
  96.          {
  97.             return 0;
  98.          }
  99.          mStats[param1] = !!mStats[param1] ? mStats[param1] + 1 : 1;
  100.          mLocalStats[param1] = !!mLocalStats[param1] ? mLocalStats[param1] + 1 : 1;
  101.          return mStats[param1];
  102.       }
  103.       
  104.       private static function Indent(param1:String, param2:Number) : String
  105.       {
  106.          var _loc3_:* = 0;
  107.          var _loc4_:String = null;
  108.          if(true)
  109.          {
  110.             ┬º┬ºpush(10);
  111.             if(true)
  112.             {
  113.                ┬º┬ºpush(int(┬º┬ºpop() - Math.floor(param1.length / 4)));
  114.             }
  115.             _loc3_ = ┬º┬ºpop();
  116.             _loc4_ = "";
  117.          }
  118.          loop0:
  119.          while(true)
  120.          {
  121.             ┬º┬ºpush(_loc3_);
  122.             while(┬º┬ºpop() >= 0)
  123.             {
  124.                ┬º┬ºpush(_loc3_);
  125.                if(true)
  126.                {
  127.                   continue loop0;
  128.                }
  129.             }
  130.             ┬º┬ºpush(param1 + _loc4_ + " = ");
  131.             if(true)
  132.             {
  133.                ┬º┬ºpush(┬º┬ºpop() + param2);
  134.             }
  135.             return ┬º┬ºpop();
  136.          }
  137.       }
  138.       
  139.       public static function set mSoundActive(param1:Boolean) : void
  140.       {
  141.          SetField("sound",_SoundActive = param1);
  142.       }
  143.       
  144.       public static function get mFastRender() : Boolean
  145.       {
  146.          return _FastRender;
  147.       }
  148.       
  149.       public static function GetRealStatName(param1:String) : String
  150.       {
  151.          var _loc2_:String = null;
  152.          var _loc3_:Object = null;
  153.          if(param1.indexOf("_") == -1)
  154.          {
  155.             return param1;
  156.          }
  157.          _loc2_ = param1.substr(0,param1.indexOf("_"));
  158.          _loc3_ = mUnitNames[param1.substr(_loc2_.length + 1)];
  159.          if(true)
  160.          {
  161.             if(_loc3_)
  162.             {
  163.                var _loc4_:* = _loc2_;
  164.                if(true)
  165.                {
  166.                   if("build" === _loc4_)
  167.                   {
  168.                      if(true)
  169.                      {
  170.                         ┬º┬ºpush(0);
  171.                         if(true)
  172.                         {
  173.                         }
  174.                      }
  175.                      else
  176.                      {
  177.                         addr137:
  178.                         ┬º┬ºpush(3);
  179.                      }
  180.                      addr152:
  181.                      switch(┬º┬ºpop())
  182.                      {
  183.                         case 0:
  184.                            return _loc3_.mType == "enemy" ? _loc3_.mName + "s deployed" : (_loc3_.mType == "none" ? "Number of " + _loc3_.mName + "s" : _loc3_.mName + "s built");
  185.                         case 1:
  186.                            return _loc3_.mName + "s have fired";
  187.                         case 2:
  188.                            return _loc3_.mName + "s have killed";
  189.                         case 3:
  190.                            return _loc3_.mName + "s have been destroyed";
  191.                         case 4:
  192.                            return _loc3_.mName + "s have reached objective";
  193.                         default:
  194.                            ┬º┬ºgoto(addr154);
  195.                      }
  196.                   }
  197.                   else
  198.                   {
  199.                      if("fired" === _loc4_)
  200.                      {
  201.                         if(true)
  202.                         {
  203.                            ┬º┬ºpush(1);
  204.                            if(false)
  205.                            {
  206.                               addr142:
  207.                            }
  208.                         }
  209.                         else
  210.                         {
  211.                            addr129:
  212.                            ┬º┬ºpush(2);
  213.                            if(false)
  214.                            {
  215.                               ┬º┬ºgoto(addr137);
  216.                            }
  217.                         }
  218.                      }
  219.                      else if("kill" === _loc4_)
  220.                      {
  221.                         ┬º┬ºgoto(addr129);
  222.                      }
  223.                      else if("death" === _loc4_)
  224.                      {
  225.                         ┬º┬ºgoto(addr137);
  226.                      }
  227.                      else if("robj" === _loc4_)
  228.                      {
  229.                         addr141:
  230.                         ┬º┬ºgoto(addr142);
  231.                         ┬º┬ºpush(4);
  232.                      }
  233.                      else
  234.                      {
  235.                         ┬º┬ºpush(5);
  236.                      }
  237.                      ┬º┬ºgoto(addr152);
  238.                   }
  239.                   ┬º┬ºgoto(addr137);
  240.                }
  241.                ┬º┬ºgoto(addr141);
  242.                addr44:
  243.             }
  244.             addr154:
  245.             return param1;
  246.          }
  247.          ┬º┬ºgoto(addr44);
  248.       }
  249.       
  250.       public static function FlushStats() : void
  251.       {
  252.          var _loc1_:* = null;
  253.          mShared.flush();
  254.          for(_loc1_ in mStats)
  255.          {
  256.          }
  257.       }
  258.       
  259.       public static function GetField(param1:String) : *
  260.       {
  261.          return mFields[param1];
  262.       }
  263.       
  264.       public static function GetLocalStat(param1:String) : uint
  265.       {
  266.          return mLocalStats[param1];
  267.       }
  268.       
  269.       public static function SetField(param1:String, param2:*) : *
  270.       {
  271.          return mFields[param1] = param2;
  272.       }
  273.       
  274.       public static function Open() : void
  275.       {
  276.          mShared = SharedObject.getLocal("army_110808");
  277.          mFields = mShared.data.mFields = !!mShared.data.mFields ? mShared.data.mFields : new Object();
  278.          if(!mShared.data.mStats)
  279.          {
  280.             SetField("sound",_SoundActive);
  281.             SetField("showmessages",_ShowMessages);
  282.             SetField("fastrender",_FastRender);
  283.             CMochiBot.SHZ_BO_UNIQUES();
  284.          }
  285.          mSoundActive = GetField("sound");
  286.          mFastRender = GetField("fastrender");
  287.          mStats = mShared.data.mStats = !!mShared.data.mStats ? mShared.data.mStats : new Object();
  288.          mUnitNames = new Object();
  289.          mUnitNames.peepak47 = {
  290.             "mName":"Freedom fighter",
  291.             "mType":"enemy"
  292.          };
  293.          mUnitNames.gunak47 = mUnitNames.peepak47;
  294.          mUnitNames.peepm16 = {
  295.             "mName":"Special forces soldier",
  296.             "mType":"friend"
  297.          };
  298.          mUnitNames.gunm16 = mUnitNames.peepm16;
  299.          mUnitNames.scudlauncher = {
  300.             "mName":"SCUD launcher",
  301.             "mType":"enemy"
  302.          };
  303.          mUnitNames.tankm1a1 = {
  304.             "mName":"M1A1 Abrams Battle tank",
  305.             "mType":"friend"
  306.          };
  307.          mUnitNames.truckflatbed = {
  308.             "mName":"Bomb truck",
  309.             "mType":"enemy"
  310.          };
  311.          mUnitNames.truckflatbedaa = {
  312.             "mName":"Homemade AA truck",
  313.             "mType":"enemy"
  314.          };
  315.          mUnitNames.apache = {
  316.             "mName":"Apache attack helicopter",
  317.             "mType":"friend"
  318.          };
  319.          mUnitNames.cessna = {
  320.             "mName":"Suicide plane",
  321.             "mType":"enemy"
  322.          };
  323.          mUnitNames.chinook = {
  324.             "mName":"Chinook transport helicopter",
  325.             "mType":"friend"
  326.          };
  327.          mUnitNames.artilleryshell = {
  328.             "mName":"Artillery Strike",
  329.             "mType":"friend"
  330.          };
  331.          mUnitNames.airbomb = {
  332.             "mName":"Air bomb strike",
  333.             "mType":"friend"
  334.          };
  335.          mUnitNames.clusterbomb = {
  336.             "mName":"Cluster bomb strike",
  337.             "mType":"friend"
  338.          };
  339.          mUnitNames.strikeairbomb = mUnitNames.airbomb;
  340.          mUnitNames.strikeclusterbomb = mUnitNames.clusterbomb;
  341.          mUnitNames.strikeartillery = mUnitNames.artilleryshell;
  342.          mUnitNames.gunm1a1 = mUnitNames.tankm1a1;
  343.          mUnitNames.hellfire = mUnitNames.apache;
  344.          mUnitNames.gunfbaa = mUnitNames.truckflatbedaa;
  345.          mUnitNames.tomahawk = {
  346.             "mName":"Tomahawk missile",
  347.             "mType":"friend"
  348.          };
  349.          mUnitNames.patriot = {
  350.             "mName":"Patriot missile",
  351.             "mType":"friend"
  352.          };
  353.          mUnitNames.bullet = {
  354.             "mName":"Bullet",
  355.             "mType":"none"
  356.          };
  357.          mUnitNames.scud = mUnitNames.scudlauncher;
  358.          mUnitNames.explosion = {
  359.             "mName":"Explosion",
  360.             "mType":"none"
  361.          };
  362.          mUnitNames.explosionsmall = mUnitNames.explosion;
  363.          mUnitNames.explosionmedium = mUnitNames.explosion;
  364.          mUnitNames.explosionlarge = mUnitNames.explosion;
  365.          CKongregate.AddStat("Enemy Kills","Enemy Kills");
  366.       }
  367.       
  368.       public static function GetStat(param1:String) : uint
  369.       {
  370.          return mStats[param1];
  371.       }
  372.       
  373.       public static function set mShowMessages(param1:Boolean) : void
  374.       {
  375.          SetField("showmessages",_ShowMessages = param1);
  376.       }
  377.       
  378.       public static function get mShowMessages() : Boolean
  379.       {
  380.          return _ShowMessages;
  381.       }
  382.    }
  383. }
  384.